import { login } from "../../common/Api/Login/index";
export const loginPost = async (userName: string, password: string) => {
  if (userName.length > 0 && password.length > 0) {
    let ploady = {
      account: userName,
      password,
    }
    // 登录逻辑
    let res = await login(ploady);
    if (res.data.code === 200) {
      let data = res.data.data
      localStorage.setItem("token", data.token);
      localStorage.setItem("permissions", JSON.stringify(data.permissions.toString()));
      return true;
    }
    return false;
  } 
    // 提示用户输入用户名和密码
    return false;
};
